/**************************************************************************************
*  std_c.h
*
*  This file contains declaration of replacement functions for some standard "C"
*  functions.
*
**************************************************************************************
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY,  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL RTJ COMPUTING BE LIABLE FOR ANY CLAIM, DAMAGES
* OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* Copyright (c) 2000-2006 RTJ Computing Pty. Ltd. All rights reserved.
**************************************************************************************/

#ifndef __stdc_h__
#define __stdc_h__

#ifndef TRUE
#define TRUE        1
#endif
#ifndef true
#define true        1
#endif
#ifndef FALSE
#define FALSE       0
#endif
#ifndef false
#define false       0
#endif
#ifndef NULL
#define NULL        ((void *)0)
#endif

//--------------------------------
// String/memory library functions
//--------------------------------
typedef unsigned int    uint;
typedef unsigned short  ushort;
typedef unsigned char   byte;
#ifndef bool
#define bool uint
#endif

void memSet(void *buf, char fill, int len);
void memCpy(void *dest, void *src, int len);
int strLen(char *s);
void strCpy(char *dest, char *text);
void strCat(char *dest, char *text);
int strCmp(char *str1, char *str2);
int strCmpI(char *str1, char *str2);
char *strChr(char *str, char ch);
char *strUpr(char *str);
char *strLwr(char *str);
char toHex(int val);
char *toHex2(int val, char *dest);
char *toHex4(int val, char *dest);
char *toHex8(int val, char *dest);
char *toDec(int val, char *dest);
int toUpperCase(int ch);
int toLowerCase(int ch);
char *int2Str(char *buf, uint val, int digits, char fill, bool left_align);
int str2Int(char *buf, bool hex);

#define strEq(a,b)      (strCmpI(a, b) == 0)

#endif 
